{% assign split_paths = include.paths | split: "," %}
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/6.23.0/polyfill.min.js" defer></script>
<script type="text/javascript" src="{{ '/assets/plugins/github-embed/github-embed.min.js' | relative_url }}" defer></script>
<div id="embed" style="height:800px;"></div>
<script type="text/javascript" defer>
    window.addEventListener('load', function() {
        githubEmbed('#embed', {
            "owner": "ktorio",
            "repo": "ktor-samples",
            "ref": "1.3.0",
            "embed": [
                {% for item in split_paths %}
                    {% assign item_trim = item | strip %}{% assign file_name = item_trim | split: "/" | last %}
                    { "type": "kt",  "label": "{{file_name}}", "path": "{{item_trim}}" }{% unless forloop.last %},{% endunless %}
                {% endfor %}
            ]
        });
    });
</script>
